package com.hainatong.shiphelper.api;

import com.base.common.model.http.HttpUtils;
import com.base.common.model.http.upLoad.UploadService;
import com.base.common.netBeanPackage.BaseResponse;
import com.hainatong.shiphelper.BuildConfig;
import com.hainatong.shiphelper.login.model.LoginParam;
import com.hainatong.shiphelper.login.model.UserBean;
import com.hainatong.shiphelper.login.model.UserInfo;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface HttpService {

    static HttpService getHttpServer() {
        return HttpUtils.getInstance(BuildConfig.isTest ? BuildConfig.API_TEST : BuildConfig.API_HOST).getHttpServer(HttpService.class);
    }

    //上传图片
    static UploadService getUpLoadFilesService() {
        return UploadService.getUpLoadFilesService(BuildConfig.isTest ? BuildConfig.API_TEST : BuildConfig.API_HOST);
    }


    //登录↓---------↓------------↓----------------↓--------↓-------------↓----------↓

    @POST("/api/User/login")
    Observable<UserBean> login(@Body LoginParam loginParam);


    /**
     * 获取用户信息
     * /api/User/getCurrentUserInfo
     */
    @POST("/api/User/getCurrentUserInfo")
    Observable<UserInfo> getCurrentUserInfo();

    /**
     * POST
     * /api/User/modifyPwd
     * 修改密码   @Query("oldPwd") String oldPwd, @Query("newPwd") String newPwd
     * oldPwd
     * newPwd
     */
    @POST("/api/User/modifyPwd")
    Observable<BaseResponse> modifyPwd(@Body Map<String,String> pwdParam);

    /**
     * POST
     * /api/User/SetHandOverPassword  设置交接密码
     */
    @POST("/api/User/SetHandOverPassword")
    Observable<BaseResponse> SetHandOverPassword(@Query("uuid") String uuid, @Query("pwd") String pwd);
    /**
     * POST
     * /api/User/ModifyHandOverPassword  修改交接密码
     */
    @POST("/api/User/ModifyHandOverPassword")
    Observable<BaseResponse> ModifyHandOverPassword(@Query("uuid") String uuid, @Query("oldPwd") String oldPwd, @Query("pwd") String pwd);

    //登录↑------------↑-----------------↑-----------↑-----------------↑------------↑


    //开始↓---------↓------------↓----------------↓--------↓-------------↓----------↓
    //结束↑------------↑-----------------↑-----------↑-----------------↑------------↑


}
